<?php $this->load->view('header');?>
<div class="page-container">
<?php $this->load->view('sidebar');?>
<!-- BEGIN CONTENT -->
<div class="page-content-wrapper">
<div class="page-content">
<?php $this->load->view('sale/_sub_nav');?>
<div class="row">
<div class="col-md-12">


<div class="admin-box">
	<?php echo form_open($this->uri->uri_string(), array('class'=>'form-horizontal','role'=>'form')); ?>
    <div class="form-body">
        <h3 class="form-section"><?php echo lang('teacher_basic_info'); ?></h3>

        <div class="row">
            <div class="col-md-6">    
                <div class="form-group<?php echo form_error('teacher_name') ? ' has-error' : ''; ?>">
                    <label class="control-label col-md-3" ><font color="red">*</font><?php echo lang('teacher_name'); ?></label>
                    <div class="col-md-6">
                         <p class="form-control-static"><?php echo set_value('teacher_name', isset($teacher) ? $teacher->teacher_name : ''); ?></p>
                    </div>
                </div>
            </div>

            <div class="col-md-6">    
                <div class="form-group<?php echo form_error('teacher_nickname') ? ' has-error' : ''; ?>">
                    <label class="control-label col-md-3" ><?php echo lang('teacher_nickname'); ?></label>
                    <div class="col-md-6">
                         <p class="form-control-static"><?php echo set_value('teacher_nickname', isset($teacher) ? $teacher->teacher_nickname : ''); ?></p>
                    </div>
                </div>
            </div>
        </div>
  
         <div class="row">
            <div class="col-md-6">    
                <div class="form-group<?php echo form_error('phone') ? ' has-error' : ''; ?>">
                    <label class="control-label col-md-3" ><font color="red">*</font><?php echo lang('teacher_phone'); ?></label>
                    <div class="col-md-4">
                        <p class="form-control-static"><?php echo set_value('phone', isset($teacher) ? $teacher->phone : ''); ?></p>
                    </div>
                </div>
            </div>

            <div class="col-md-6">    
                <div class="form-group<?php echo form_error('tel') ? ' has-error' : ''; ?>">
                    <label class="control-label col-md-3" ><?php echo lang('teacher_tel'); ?></label>
                    <div class="col-md-4">
                        <p class="form-control-static"><?php echo set_value('tel', isset($teacher) ? $teacher->tel : ''); ?></p>
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-md-6">    
                <div class="form-group">
                    <label class="control-label col-md-3" ><?php echo lang('teacher_sex'); ?></label>
                    <div class="col-md-9">
                            <?php echo $teacher->sex==1?lang('teacher_sex_male'):lang('teacher_sex_female'); ?> </label>
                    </div>
                </div>
            </div>

            <div class="col-md-6">    
                <div class="form-group">
                    <label class="control-label col-md-3" ><?php echo lang('teacher_address'); ?></label>
                    <div class="col-md-9">
                        <p class="form-control-static"><?php echo set_value('teacher_address', isset($teacher) ? $teacher->address : ''); ?></p>
                    </div>
                </div>
            </div>
        </div>

         <div class="row">
            <div class="col-md-6">    
                <div class="form-group<?php echo form_error('idcard') ? ' has-error' : ''; ?>">
                    <label class="control-label col-md-3" ><?php echo lang('teacher_idcard'); ?></label>
                    <div class="col-md-9">
                        <p class="form-control-static"><?php echo set_value('idcard', isset($teacher) ? $teacher->idcard : ''); ?></p>
                    </div>
                </div>
            </div>

            <div class="col-md-6">    
                <div class="form-group<?php echo form_error('birthday') ? ' has-error' : ''; ?>">
                    <label class="control-label col-md-3" ><?php echo lang('teacher_birthday'); ?></label>
                    <div class="col-md-5">
                      <p class="form-control-static"><?php echo set_value('teacher_birthday', isset($teacher) ? $teacher->birthday : ''); ?></p>
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-md-6">    
                <div class="form-group">
                    <label class="control-label col-md-3" ><?php echo lang('bf_email'); ?></label>
                    <div class="col-md-9">
                        <p class="form-control-static"><?php echo set_value('email', isset($teacher) ? $teacher->email : ''); ?></p>
                    </div>
                </div>
            </div>

            <div class="col-md-6">    
                <div class="form-group<?php echo form_error('entry_date') ? ' has-error' : ''; ?>">
                    <label class="control-label col-md-3" ><?php echo lang('teacher_entry_date'); ?></label>
                    <div class="col-md-5">
                         <p class="form-control-static"><?php echo set_value('entry_date', isset($teacher) ? $teacher->entry_date : ''); ?></p>
                    </div>
                </div>
            </div>

        </div>  
        
        <div class="row">
            <div class="col-md-6">    
                <div class="form-group<?php echo form_error('type') ? ' has-error' : ''; ?>">
                    <label class="control-label col-md-3" ><font color="red">*</font><?php echo lang('teacher_type'); ?></label>
                    <div class="col-md-4">
                            <?php
                            $teacher_type = $this->config->item('comm.teacher_type');
                            $type = isset($teacher_type[$teacher->type])?$teacher_type[$teacher->type]:'';
                            echo $type;
                            ?>
                        <span class="help-block"><?php echo form_error('type'); ?></span>
                    </div>
                </div>
            </div>

            <div class="col-md-6">    
                <div class="form-group<?php echo form_error('level') ? ' has-error' : ''; ?>">
                    <label class="control-label col-md-3" ><?php echo lang('teacher_type'); ?></label>
                    <div class="col-md-4">
                        <?php
                        $teacher_type = $this->config->item('comm.teacher_level');
                        $level = isset($teacher_level[$teacher->level])?$teacher_level[$teacher->level]:'';
                        echo $type;
                        ?>
                        <span class="help-block"><?php echo form_error('level'); ?></span>
                    </div>
                </div>
            </div>
        </div>



        <div class="row">
             <div class="col-md-6"> 
                <div class="form-group">
                    <label class="control-label col-md-3"><?php echo lang('teacher_info'); ?></label>
                    <div class="col-md-9">
                        <textarea name="info" class="form-control"></textarea>
                        <span class="help-block"></span>
                    </div>
                </div>
             </div>

        </div>  

        <h3 class="form-section"><?php echo lang('teacher_system_info'); ?></h3>

         <div class="row">
            <div class="col-md-6">    
                <div class="form-group<?php echo form_error('consultant') ? ' has-error' : ''; ?>">
                    <label class="control-label col-md-3" ><?php echo lang('teacher_consultant'); ?></label>
                    <div class="col-md-9">
                        <select name="consultant" id="consultant" class="form-control" >
                                <?php if (isset($consultants) && is_array($consultants) && count($consultants)) :?>
                                    <?php foreach ($consultants as $consultant) :?>
                                         <option value="<?php echo $consultant->id; ?>" <?php echo set_select('consultant', $consultant->id, $current_user->id); ?>>
                                            <?php e(ucfirst($consultant->display_name)); ?>
                                        </option>
                                    <?php endforeach; ?>
                                <?php else:?>
                                    <option value="0">无</option>
                                <?php endif;?>
                        </select>
                        <span class="help-block"><?php echo form_error('consultant'); ?></span>
                    </div>
                </div>
            </div> 
        </div>
    </div> 

    <div class="form-actions fluid">
        <div class="row">
            <div class="col-md-6">
                <div class="col-md-offset-3 col-md-9">
                    <button type="submit" class="btn green" name="save"><?php echo lang('bf_action_save');?></button>
                    <a href="<?php echo site_url('/teach/teachers');?>" class="btn default"><?php echo lang('bf_action_cancel');?></a>
                </div>
            </div>
            <div class="col-md-6">
            </div>
        </div>
    </div>         
	<?php echo form_close(); ?>
</div>

</div>
</div>
</div>
</div>


<?php $this->load->view('footer');?>

<script type="text/javascript" src="assets/scripts/custom/clue.js"></script>

<script>
    jQuery(document).ready(function() {
        App.init(); // initlayout and core plugins
    });
</script>

</body>
<!-- END BODY -->
</html>
